package cn.sq.musicserver.config;//package cn.sq.scaffold.ffmpeg.config;
//
//import lombok.extern.slf4j.Slf4j;
//import org.aspectj.lang.JoinPoint;
//import org.aspectj.lang.ProceedingJoinPoint;
//import org.aspectj.lang.annotation.*;
//import org.springframework.stereotype.Component;
//
///**
// * Created with IntelliJ IDEA.
// * User: SQ
// * Date: 2020/11/24
// * Time: 14:11
// * Description: 截取返回值自动返回值
// */
//@Aspect
//@Component
//@Slf4j
//public class ControllerAop {
//
//    private  final String AOP_POINTCUT = "execution(* cn.sq.scaffold.ffmpeg..*Controller.*(..))";
//
//    @Pointcut(AOP_POINTCUT)
//    public void ControllerAop() {
//    }
//
//    /**
//     * @description  在连接点执行之前执行的通知
//     */
////    @Before("ControllerAop()")
////    public void doBefore(JoinPoint joinPoint){
////        System.out.println("doBefore！");
////    }
//
////    /**
////     * 后置最终通知（目标方法只要执行完了就会执行后置通知方法）
////     */
////    @After("ControllerAop()")
////    public void doAfter(JoinPoint joinPoint){
////        System.out.println("doAfter！");
////    }
////
////    /**
////     * @description  在连接点执行之后执行的通知（返回通知）
////     */
////    @AfterReturning(value = "ControllerAop()",returning="responseBean")
////    public void doAfterReturning(JoinPoint joinPoint, Object responseBean){
////        if (responseBean instanceof ResponseBean){
////            ResponseBean res = (ResponseBean)responseBean;
////            if(res.getData() instanceof Boolean){
////               boolean resbol= (Boolean) res.getData();
////                if (!resbol){
////                    try {
////                        proceed=StatusCode.codeToResponseBean(StatusCode.Error);
////                    } catch (Throwable throwable) {
////                        log.error(throwable.getMessage());
////                    }
////                }
////            }
////
////        }
////    }
////
////    /**
////     * @description  在连接点执行之后执行的通知（异常通知）
////     */
////    @AfterThrowing("ControllerAop()")
////    public void doAfterThrowing(){
////        System.out.println("异常通知：doAfterThrowing！");
////    }
//
////    @Around("ControllerAop()")
////    public void Around(ProceedingJoinPoint joinPoint){
////
////        try {
////            Object proceed = joinPoint.proceed();
////            if (proceed instanceof ResponseBean){
////                ResponseBean res = (ResponseBean)proceed;
////                if(res.getData() instanceof Boolean){
////                    boolean resbol= (Boolean) res.getData();
////                    if (!resbol){
////                        try {
////                            res=StatusCode.codeToResponseBean(StatusCode.Error);
////                        } catch (Throwable throwable) {
////                            log.error(throwable.getMessage());
////                        }
////                    }
////                }
////
////            }
////        } catch (Throwable throwable) {
////            log.error(throwable.getMessage());
////        }
////
////    }
//
//}
